-
Notifications
You must be signed in to change notification settings - Fork 844
remove MSI package and replace with app-local VSIX packages #4819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4a070eb to
a6ef545
Compare
|
Perhaps important to note that it should remain part of VS MSBuild tools. I reported that F# 4.0 is missing there, but new releases should continue to be part of that, I hope, since it's the go to method used on build servers |
1edfc0b to
17e131f
Compare
|
@abelbraaksma I verified the BuildTools scenario with the internal build I generated and it worked as expected. I updated the PR description with all scenarios I tested as well as the checkbox I used for the BuildTools scenario. |
09d3550 to
fff1707
Compare
|
@brettfo For the SxS case, does that rely on nothing else changing the MSI? If we have to update something else, won't that mean that the previous builds will stop working when the new MSI is installed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the above excluded - that doesn't seem right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The listed files have either already been signed during this build (fsi, etc.) or come from a nuget package (microsoft.build.*).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be commented somehow so that people know why these are excluded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, no. The JSON file format specification doesn't allow comments as per RFC 7159.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had some problems about ngen priority with Roslyn - is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll talk to some folks on the compiler team to see what issues they had.
KevinRansom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gosh this looks good.
|
@brettfo , that sounds great! If there's something specifically you'd want me to test, let me know. I'm traveling, but I'll try to get to it sooner rather than later. |
|
I spoke with some internal teams about my initial plan of staging this in two PRs, but the number of potential pitfalls is apparently enormous. I've opted instead to do all of the MSI removal in one PR to keep this atomic. |
Pilchie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'd like someone from MSBuild to sign off, and I'd like to make sure we check with the setup team about both SxS installs and upgrades. Ideally a straight upgrade would remove the old MSI, but SxS installs wouldn't. Not sure if that's possible though.
| path is unchanged from the original legacy templates and if a new reference assembly can be found at the new location. | ||
| --> | ||
| <Target Name="RedirectFSharpCoreReferenceToNewRedistributableLocation" BeforeTargets="ResolveAssemblyReferences"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how I feel about this target. It's very clever, but may also be very surprising to people, and I feel like various bits of tooling that only use the evaluated MSBuild model will be wrong because they will still use the old hint path.
With that said, I'm not sure of anything better :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the best we could come up with for not breaking legacy projects, but still removing the MSI from the install toolchain (which unfortunately means we can't have a global, well-known location.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. What did the old templates put in user proj files?
Does this do the right thing in design-time builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any issues with design time builds, but I'll do another pass checking for this specifically.
The old templates created the project files like this:
<ItemGroup>
...
<Reference Include="FSharp.Core">
<Name>FSharp.Core</Name>
<AssemblyName>FSharp.Core.dll</AssemblyName>
<HintPath>$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll</HintPath>
</Reference>
...
</ItemGroup>and we want to make sure we don't break those scenarios.
| version=$(FSharpPackageVersion) | ||
|
|
||
| folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" | ||
| folder "InstallDir:MSBuild\15.0\Bin\FSharpSdk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rainersigwald - is this the right sort of convention here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the Roslyn behavior for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not expect F# to need to be in the MSBuild bin folder. C# is special because we both used to be in the framework. Plus, people often construct relative paths, so changing it can break folks. Did something break with the old path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original location from the MSI was C:\Program Files (x86)\Microsoft SDKs\FSharp\.... My first round of this PR moved the compiler to Common7\IDE\CommonExtensions\Microsoft\FSharpSdk, but that felt wrong for the BuildTools SKU because there is no IDE. The second round of this PR I moved it to be under MSBuild to copy C#. Do you have a suggestion for a better place to put it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree with @rainersigwald. I don't this this is an acceptable location, especially given that you're redistributing our old binaries. Common7\IDE\CommonExtensions\Microsoft\FSharpSdk seems fine with me, that's where NuGet is and they're required in no-IDE scenarios.
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
|
||
| <Import Project="$(MSBuildThisFileDirectory)..\..\..\..\..\Common7\IDE\CommonExtensions\Microsoft\FSharpCompiler\Microsoft.FSharp.NetSdk.props" /> | ||
| <Import Project="$(VsInstallRoot)\MSBuild\15.0\Bin\FSharp\Microsoft.FSharp.NetSdk.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can VsInstallRoot be counted on to exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this that value will always be present, but reading the comment it could behave oddly with $(PlatformToolset). Would you prefer I go back to the $(MSBuildThisFileDirectory)..\..\..\etc method? It doesn't look as clean, but will always produce consistent results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlatformToolset is a pretty C++ concept, so I'm not too worried about that. However, I do wonder about things like the build sku. I'll defer to @rainersigwald or @AndyGerlicher for what should happen here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tested on a clean machine with only the BuildTools version installed. Running msbuild MyProject.fsproj showed the correct compiler and FSharp.Core being used which means these targets redirected appropriately.
|
@Pilchie Regarding your comment about SxS installs, I verified that I could install/uninstall 15.7 and my custom build in any order. 15.7 always removed the MSI when it was uninstalled, but that never interfered with my custom build. From the internal email conversation I gathered that upgrade would trigger an uninstall. |
|
I inferred that upgrade would trigger an uninstall/reinstall if the new version contains the MSI, but what happens if the new version doesn't? Would a straight uninstall be a problem if someone upgrades Preview channel from P2 (with MSI) to P3 (without MSI), while also having 15.7 installed, or would ref-counting deal with that. I think things should work out, but I think we have some more testing to consider - or at least thought experiments involving people who know more about setup than me :) |
|
It appears our existing MSI is properly ref-counted so the scenario of having multiple instances installed and upgrading one of them (which will in turn /uninstall the MSI) should work. I simulated this by checking the following:
|
|
@Pilchie, did you have any other questions regarding this PR? I think I covered your issues above, although maybe not with enough depth. |
|
LGTM, but I would feel more comfortable if we can get someone from the setup team to take a look, and would really like @rainersigwald, or another MSBuild dev to take a look too. |
rainersigwald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving into the MSBuild folder is my biggest concern.
| file source="$(BinariesFolder)\net40\bin\fsiAnyCpu.exe.config" | ||
| file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Conversion.Core.dll" | ||
| file source="$(BinariesFolder)\net40\bin\Microsoft.Build.dll" | ||
| file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Engine.dll" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you redistributing MSBuild assemblies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Our current MSI ships these, too. If you have F# installed on your machine these assemblies live next to our compiler at C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rainersigwald. Unfortunately yes. The F# compiler needs this, it's something we are going to try to eliminate eventually, but it's not going to happen quickly.
|
|
||
| <ItemGroup> | ||
| <!-- Update references to `.NETCore\*\FSharp.Core.dll`. --> | ||
| <Reference Update="%(Reference.Identity)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use Update= inside a target . . . it doesn't do the right thing. dotnet/msbuild#2835
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate? I read the attached issue, but wasn't able to follow. In my testing the Update= seemed to do the right thing; the <HintPath> for FSharp.Core was appropriately redirected.
| path is unchanged from the original legacy templates and if a new reference assembly can be found at the new location. | ||
| --> | ||
| <Target Name="RedirectFSharpCoreReferenceToNewRedistributableLocation" BeforeTargets="ResolveAssemblyReferences"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. What did the old templates put in user proj files?
Does this do the right thing in design-time builds?
| <ItemGroup> | ||
| <!-- Update references to `.NETCore\*\FSharp.Core.dll`. --> | ||
| <Reference Update="%(Reference.Identity)" | ||
| Condition="'%(Reference.Identity)' == 'FSharp.Core' and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter if this misses references that were referenced by full assembly identity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These updates are only to catch project files that never changed the default values, and the F# templates (to my knowledge) have never used the full assembly identity. If a developer modifies this value then they're on their own for locating FSharp.Core.
|
I really wish this could be moved to a NuGet package or MSBuild SDK that could just be acquired a build-time (or local offline feed) :( I realize that would likely change project files to work though so it might be out. At minimum though, this shouldn't go under MSBuild bin folder. |
992b6c1 to
f77094b
Compare
|
I've changed the location of the F# compiler back to |
|
@AndyGerlicher @rainersigwald I've moved the compiler to |
|
Ping to @rainersigwald. You mentioned above that |
|
Ah, sorry. |
|
|
|
Include and Remove are fine. When we added Update to outside-a-target items, we missed a case inside targets that should have been accounted for.
|
|
@rainersigwald I re-worked Edit, I spoke with Rainer offline and it turns out I just need to remove the |
|
Final validation build (with removed |
This completely removes our MSI package and replaces it with new V3 VSIX packages which makes us fully side-by-side compliant.
I tested the following scenarios:
%FSHARPINSTALLDIR%=C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0\(set by the current MSI)where fscreports the above locationmsbuild test.fsprojshows fsc being invoked from that location for both legacy and SDK style projectsmsbuildreported pullingFSharp.Core.dllfrom%ProgramFiles(x86)%\Reference Assemblies\....dotnet builduses its own fsc as expected%FSHARPINSTALLDIR%=C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\FSharp\(new location for the VSIX)where fscreports the above locationmsbuild test.fsprojshows fsc being invoked from that location for both legacy and SDK style projectsmsbuildreported pullingFSharp.Core.dllfrom%VSINSTALLDIR%\MSBuild\15.0\Bin\FSharpSdkthanks to the redirection inMicrosoft.FSharp.targets.dotnet builduses its own fsc as expectedC:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0\for both desktop and SDK style projectsC:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\FSharp\for both desktop and SDK style projects